<template>
  <el-form :disabled="true">
    <el-form-item label="账号">
      <el-input v-model.trim="name" />
    </el-form-item>
    <el-form-item label="创建时间">
      <el-input v-model.trim="create_time" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="submit">更改</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  props: {
    user: {
      type: Object,
      default: () => {
        return {
          name: '',
          email: ''
        }
      }
    }
  }, computed: {
    ...mapGetters([
      'name',
      'avatar',
      'roles',
      'create_time'
    ])
  },
  methods: {
    submit() {
      this.$message({
        message: 'User information has been updated successfully',
        type: 'success',
        duration: 5 * 1000
      })
    }
  }
}
</script>
